package com.example.mapper;

import com.example.domain.Checkid;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CheckidMapper {

    @Insert("insert into [dbo].[Checkid] (UID,STARTTIME,COMPLETETIME,TIPS) " +
            "values (#{uid},#{starttime},#{completetime},#{tips})")
    Boolean insertCheckid(Integer uid,String starttime,String completetime,String tips);

    @Update("update [dbo].[Checkid] set TIPS = #{tips} where CHECKID = #{checkid}")
    Boolean updateTips(Integer checkid,String tips);

    @Select("select * from [dbo].[Checkid]")
    List<Checkid> showAllCheckid();

    @Select("select COMPLETETIME from [dbo].[Checkid] where CHECKID = #{checkid}")
    String showCompleteTime(Integer checkid);

    @Select("select COMPLETETIME from [dbo].[Checkid]")
    List<String> showAllCompletetime();

    @Select("select CHECKID from [dbo].[Checkid] where COMPLETETIME = #{completetime}")
    Integer selectCheckidByCompletetime(String completetime);

    @Delete("delete from [dbo].[Checkid] where CHECKID = #{checkid}")
    Boolean deletCheckId(Integer checkid);

}
